var express = require('express');
var router = express.Router();
const {
  regUser,
  login
} = require('../public/javascripts/login')

// /* GET users listing. */ url   /users/add
// router.get('/add', function(req, res, next) {
//   res.send('respond with a resource');
// });

router.post('/add',(req,res,next) => {
  // 通过 req.body 获取请求体重的包含的 url-encoded 格式的数据
  console.log(req.body);
  const userInfo = req.body;
  if (userInfo.username == '' || userInfo.password == '') {
    return res.send({
      status: 1,
      msg: '用户和密码不能为空'
    })
  }
  // 执行注册函数
})

module.exports = router;
